package other.example;

import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.JComboBox;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JTextField;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class DataSourceConnectFrame extends JFrame {

	private JPanel contentPane;
	private JTextField usernameTextField;
	private JTextField passwordTextField;
	private JTextField textField;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					DataSourceConnectFrame frame = new DataSourceConnectFrame();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public DataSourceConnectFrame() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 505, 360);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JLabel lblNewLabel = new JLabel("\u6570\u636E\u5E93\u7C7B\u578B:");
		lblNewLabel.setBounds(5, 5, 118, 33);
		contentPane.add(lblNewLabel);
		
		JComboBox databaseTypeComboBox = new JComboBox();
		databaseTypeComboBox.setEditable(true);
		databaseTypeComboBox.setModel(new DefaultComboBoxModel(new String[] {"Oracle", "Mysql", "SqlServer"}));
		databaseTypeComboBox.setBounds(105, 9, 160, 29);
		contentPane.add(databaseTypeComboBox);
		
		JLabel label = new JLabel("\u670D\u52A1\u5668\u540D\u79F0:");
		label.setBounds(5, 51, 118, 33);
		contentPane.add(label);
		
		JComboBox serverComboBox = new JComboBox();
		serverComboBox.setEditable(true);
		serverComboBox.setBounds(105, 51, 160, 29);
		contentPane.add(serverComboBox);
		
		JLabel usernameLabel = new JLabel("\u7528\u6237\u540D:");
		usernameLabel.setBounds(5, 91, 72, 30);
		contentPane.add(usernameLabel);
		
		usernameTextField = new JTextField();
		usernameTextField.setBounds(105, 90, 160, 33);
		contentPane.add(usernameTextField);
		usernameTextField.setColumns(10);
		
		JLabel passwordlabel = new JLabel("\u5BC6  \u7801:");
		passwordlabel.setBounds(5, 137, 72, 30);
		contentPane.add(passwordlabel);
		
		passwordTextField = new JTextField();
		passwordTextField.setColumns(10);
		passwordTextField.setBounds(105, 136, 160, 33);
		contentPane.add(passwordTextField);
		
		JLabel databaseNameLabel = new JLabel("\u6570\u636E\u5E93\u540D\u79F0:");
		databaseNameLabel.setBounds(5, 183, 92, 30);
		contentPane.add(databaseNameLabel);
		
		textField = new JTextField();
		textField.setColumns(10);
		textField.setBounds(105, 182, 160, 33);
		contentPane.add(textField);
		
		JButton btnNewButton = new JButton("\u6D4B\u8BD5\u8FDE\u63A5");
		btnNewButton.setBounds(5, 237, 106, 38);
		contentPane.add(btnNewButton);
		
		JButton okButton = new JButton("\u786E\u5B9A");
		okButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
			}
		});
		okButton.setBounds(246, 240, 83, 32);
		contentPane.add(okButton);
		
		JButton cancleButton = new JButton("\u53D6\u6D88");
		cancleButton.setBounds(363, 240, 92, 32);
		contentPane.add(cancleButton);
	}
}
